<template>
  <XTable :tableList="tableList" :tableData="tableData"/>
</template>

<script>
import { XTable } from '@/components/@fhsy/x-tool'
export default {
  components: {
    XTable
  },
  data () {
    return {
      tableList: [
        { label: '日期', prop: 'date', width: 200 },
        { label: '日期截取后', prop: 'date', width: 200, x: { substring: [0, 10] } },
        { label: '状态', prop: 'status' },
        { label: '状态判断后', prop: 'status', x: {if: [{0: '不可用'}, {1: '可用'}]} },
        { label: '品牌', prop: 'brand' },
        { label: '品牌循环后', prop: 'brand', x: { for: true, forSeparator: '，' } },
        { label: '姓名(为空替换符)', prop: 'name', empty: '---' }
      ],
      tableData: [
        { date: '2020-05-02 12:30:40', name: '白羊', status: 1, brand: '["aa","bb"]' },
        { date: '2020-06-04 12:30:40', name: '白羊', status: 0, brand: ['小米'] },
        { date: '2020-07-01 12:30:40', name: '', status: 0, brand: ['联想'] },
        { date: '2020-08-03 12:30:40', name: '白羊', status: 1, brand: ['联想', '小米', '华为'] }
      ]
    }
  }
}
</script>
